"use strict";
cc._RF.push(module, '0091d1MrmRCIZHo9EOCvOhA', 'MultiModeViewUI');
// scripts/MultiModeViewUI.js

"use strict";

var e = require;
var t = module;
var o = exports;

var _ii,
    nn = void 0 && (void 0).__extends || (_ii = function ii(t, e) {
  return (_ii = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _ii(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    rr = void 0 && (void 0).__awaiter || function (t, e, o, i) {
  return new (o || (o = Promise))(function (n, a) {
    function r(t) {
      try {
        l(i.next(t));
      } catch (e) {
        a(e);
      }
    }

    function s(t) {
      try {
        l(i["throw"](t));
      } catch (e) {
        a(e);
      }
    }

    function l(t) {
      var e;
      t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
        t(e);
      })).then(r, s);
    }

    l((i = i.apply(t, e || [])).next());
  });
};

var oo = void 0 && (void 0).__decorate || function (e, t, a, n) {
  var i,
      o = arguments.length,
      s = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);else for (var r = e.length - 1; r >= 0; r--) {
    (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
  }
  return o > 3 && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var a = e("GlobalParams"),
    n = e("ModuleUI"),
    i = e("GuideMaskViewUI"),
    r = e("TipViewUI"),
    s = cc._decorator,
    l = s.ccclass,
    _ = s.property,
    c = function (e) {
  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    return t.dr_btn_light = null, t.zd_btn_light = null, t;
  }

  return nn(t, e), t.prototype.initView = function () {
    e.prototype.initView.call(this), a.GlobalParams.MathcTimeInfo.open = !1, a.GlobalParams.MathcTimeInfo.name = "", this.dr_btn_light.active = !0, this.zd_btn_light.active = !1, a.GlobalParams.ChangeGameMode = 0, a.GlobalParams.PlayGuideMode && this.uiManager.showPopup("GuideMaskViewUI", function (e) {
      e.getComponent(i["default"]).showGuideInfoView(1);
    });
  }, t.prototype.OnClick = function (t) {
    switch (e.prototype.OnClick.call(this, t), t.node.name) {
      case "ranking_btn":
        1 != a.GlobalParams.ChangeGameMode ? this.uiManager.showPopup("MatchViewUI") : this.uiManager.showPopup("InviteViewUI");
        break;

      case "dr_btn":
        a.GlobalParams.ChangeGameMode = 0, this.dr_btn_light.active = !0, this.zd_btn_light.active = !1;
        break;

      case "zd_btn":
        a.GlobalParams.ChangeGameMode = 1, this.dr_btn_light.active = !1, this.zd_btn_light.active = !0;
        break;

      case "fire_btn":
        a.GlobalParams.ChangeGameMode = 2, this.uiManager.showPopup("MatchViewUI");
        break;

      case "clone_mode_btn":
        a.GlobalParams.MultiModeIndex = 1, this.uiManager.showPopup("MatchViewUI");
        break;

      case "dnf_mode_btn":
        var o = a.GlobalParams.playerSkinInfo.value;
        o.have_hero.length < 3 ? this.uiManager.showPopup("TipViewUI", function (e) {
          e.getComponent(r["default"]).showTipInfo("当前拥有的英雄数不够3名英雄\n请获得3名英雄后再进行挑战\n当前拥有英雄数为：" + o.have_hero.length);
        }) : (a.GlobalParams.MultiModeIndex = 2, this.uiManager.showPopup("DungeonModeViewUI"));
        break;

      case "5v5_mode_btn":
        this.uiManager.showPopup("TipViewUI", function (e) {
          e.getComponent(r["default"]).showTipInfo("该模式暂未开放\n请尽情期待");
        });
        break;

      case "back_btn":
        a.GlobalParams.MultiModeIndex = 0, a.GlobalParams.MathcTimeInfo.open = !0, this.closeThisPopup();
    }
  }, oo([_(cc.Node)], t.prototype, "dr_btn_light", void 0), oo([_(cc.Node)], t.prototype, "zd_btn_light", void 0), oo([l], t);
}(n["default"]);

o["default"] = c;

cc._RF.pop();